package com.nw.news.bean;

import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * 文件
 * @version 1.0
 */
public class AttachFile implements Parcelable {
	private String id;
	private String name;
	private String path;
	private String localPath;
	private Uri localUri;

	private Bitmap imgBitmap;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Uri getLocalUri() {
		return localUri;
	}

	public void setLocalUri(Uri localUri) {
		this.localUri = localUri;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getLocalPath() {
		return localPath;
	}

	public void setLocalPath(String localPath) {
		this.localPath = localPath;
	}

	public Bitmap getImgBitmap() {
		return imgBitmap;
	}

	public void setImgBitmap(Bitmap imgBitmap) {
		this.imgBitmap = imgBitmap;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(this.id);
		dest.writeString(this.name);
		dest.writeString(this.path);
		dest.writeString(this.localPath);
		dest.writeParcelable(this.localUri, flags);
		dest.writeParcelable(this.imgBitmap, flags);
	}

	public AttachFile() {
	}

	protected AttachFile(Parcel in) {
		this.id = in.readString();
		this.name = in.readString();
		this.path = in.readString();
		this.localPath = in.readString();
		this.localUri = in.readParcelable(Uri.class.getClassLoader());
		this.imgBitmap = in.readParcelable(Bitmap.class.getClassLoader());
	}

	public static final Creator<AttachFile> CREATOR = new Creator<AttachFile>() {
		@Override
		public AttachFile createFromParcel(Parcel source) {
			return new AttachFile(source);
		}

		@Override
		public AttachFile[] newArray(int size) {
			return new AttachFile[size];
		}
	};
}
